<?php $side_bar	=	 $this->requestAction(array('controller' => 'properties', 'action' => 'side_bar_property_seatch')); 
		$pt = $ct =	$ci	= $mnb = $mxb =	$mnp = $mxp	= $mna =$mxa = $mnbt= '';
		if(isset($this->request->query['pt']) and !empty($this->request->query['pt']))
		$pt	=	(int)trim($this->request->query['pt']);//Property Type ID


		if(isset($this->request->query['ci']) and !empty($this->request->query['ci']))
		$ci	=	(int)trim($this->request->query['ci']);//Property City ID
		
		if(isset($this->request->query['ct']) and !empty($this->request->query['ct']))
		$ct	=	 trim($this->request->query['ct']);//Cantract Type

		if(isset($this->request->query['mnb']) and !empty($this->request->query['mnb']))
		$mnb	=	 (int)trim($this->request->query['mnb']);//Cantract Type
		if(isset($this->request->query['mnbt']) and !empty($this->request->query['mnbt']))
		$mnbt	=	 (int)trim($this->request->query['mnbt']);//Cantract Type


$rent_active	=$buy_active	='';
if($ct=='rent')
$rent_active	=' active ';
else
$buy_active	=' active ';
		
?>
                    <div class="widget sidebar-widget">
 						<h3 class="widgettitle"><?php echo __('Search Properties'); ?></h3>
                  <div class="tabs">
                <ul class="nav nav-tabs">
                  <li class="<?php echo $buy_active; ?> col-md-6 col-sm-6 col-xs-6" style="padding:0px; margin-right:0px; margin-left:0px;"> <a data-toggle="tab" href="#descriptionone"> <?php echo __('For Buy'); ?> </a> </li>
                  <li class="<?php echo $rent_active; ?> col-md-6 col-sm-6 col-xs-6"  style="padding:0px; margin-right:0px;margin-left:0px;"> <a data-toggle="tab" href="#amenitiestwo">  <?php echo __('For Rent'); ?> </a> </li>
                </ul>
                <div class="tab-content">
                  <div id="descriptionone" class="tab-pane active">
                          <div class="full-search-form">
								<?php echo $this->Form->create('Property', array('type'=>'get','role' => 'form','url'=>array('controller'=>'Properties','action'=>'index'))); ?>

							<?php echo $this->Form->input('pt', array('selected'=>$pt,'options'=>$side_bar['getPropertyType'],'required'=>false,'empty'=>'Select Type','label' => false,'div' => false,'class' => 'form-control input-lg selectpicker', 'placeholder' => 'Propery Type'));?>
                            <?php //echo $this->Form->input('ct', array('selected'=>$ct,'options'=>array('rent'=>'Rent','sale'=>'Buy'),'required'=>false,'empty'=>'Select Contract','label' => false,'div' => false,'class' => 'form-control input-lg selectpicker', 'placeholder' => 'Propery Type'));?>
                            <?php echo $this->Form->input('ct', array('value'=>'sale','type'=>'hidden'));?>
                            <?php echo $this->Form->input('ci', array('selected'=>$ci,'options'=>$side_bar['getCity'],'empty'=>'Select City', 'required'=>false,'label' => false,'div' => false,'class' => 'form-control input-lg selectpicker', 'placeholder' => 'Propery Type'));?>
                            <?php echo $this->Form->input('mnb', array('selected'=>$mnb,'options'=>$dropdown_options,'empty'=>'Min Beds', 'required'=>false,'label' => false,'div' => false,'class' => 'form-control input-lg selectpicker', 'placeholder' => 'Bath'));?>
                            <?php echo $this->Form->input('mnbt', array('selected'=>$mnbt,'options'=>$dropdown_options,'empty'=>'Min Baths', 'required'=>false,'label' => false,'div' => false,'class' => 'form-control input-lg selectpicker', 'placeholder' => 'Bath'));?>
                          <button type="submit" class="btn btn-primary btn-block"><i class="fa fa-search"></i> <?php echo __('Search'); ?></button>
                            </form>
                          </div>

                  </div>
                  <div id="amenitiestwo" class="tab-pane">
                    	<div class="additional-amenities">
                          <div class="full-search-form">
								<?php echo $this->Form->create('Property', array('type'=>'get','role' => 'form','url'=>array('controller'=>'Properties','action'=>'index'))); ?>

							<?php echo $this->Form->input('pt', array('selected'=>$pt,'options'=>$side_bar['getPropertyType'],'required'=>false,'empty'=>'Select Type','label' => false,'div' => false,'class' => 'form-control input-lg selectpicker', 'placeholder' => 'Propery Type'));?>
                            <?php //echo $this->Form->input('ct', array('selected'=>$ct,'options'=>array('rent'=>'Rent','sale'=>'Buy'),'required'=>false,'empty'=>'Select Contract','label' => false,'div' => false,'class' => 'form-control input-lg selectpicker', 'placeholder' => 'Propery Type'));?>
                            <?php echo $this->Form->input('ct', array('value'=>'rent','type'=>'hidden'));?>
                            <?php echo $this->Form->input('ci', array('selected'=>$ci,'options'=>$side_bar['getCity'],'empty'=>'Select City', 'required'=>false,'label' => false,'div' => false,'class' => 'form-control input-lg selectpicker', 'placeholder' => 'Propery Type'));?>
                            <?php echo $this->Form->input('mnb', array('selected'=>$mnb,'options'=>$dropdown_options,'empty'=>'Min Beds', 'required'=>false,'label' => false,'div' => false,'class' => 'form-control input-lg selectpicker', 'placeholder' => 'Bath'));?>
                            <?php echo $this->Form->input('mnbt', array('selected'=>$mnbt,'options'=>$dropdown_options,'empty'=>'Min Baths', 'required'=>false,'label' => false,'div' => false,'class' => 'form-control input-lg selectpicker', 'placeholder' => 'Bath'));?>
                          <button type="submit" class="btn btn-primary btn-block"><i class="fa fa-search"></i> <?php echo __('Search'); ?></button>
                            </form>
                          </div>
                    </div>
                  </div>
                </div>
              </div>
                     